package kr.co.doriclassic.pro21;

import java.util.Arrays;
import java.util.Scanner;

class NotFoundExeption extends Exception{
	public NotFoundExeption(String message) {
		super(message);
	}
	
}

public class NotFoundExceptionTest{
	static int[] arr = {1,2,3,4,5};
	public static void main(String[] args)  {
		int index;
		Scanner sc = new Scanner(System.in);
		System.out.print("찾으실 번호 : ");
		index=sc.nextInt();
		
		for (int s : arr) {
			System.out.print(s);
		}
		
		System.out.println();
		
		try {
			searchArray(index);
		} catch (NotFoundExeption e) {
			System.out.println(e.getMessage());
		}
	}
	
	public static void searchArray(int i) throws NotFoundExeption {
		if(Arrays.binarySearch(arr, i)>0)	
			System.out.println("Found");
		else
			throw new NotFoundExeption("Not Found");

	}
}